home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / POW10.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  300 b   |  16 lines

  1.  /* pow10.c from page 235*/
  2.  #include <stdio.h>
  3.  #include <stdlib.h>
  4.  #include <math.h>
  5.  main(int argc, char **argv)
  6.  {
  7.     int p;
  8.     if(argc < 2)
  9.     {
  10.         printf("usage: %s <integer_power>\n", argv[0]);
  11.         exit(1);
  12.  
  13.     }
  14.     p = atoi(argv[1]);
  15.     printf("10 to the power %d = %f\n" , p, pow10(p));
  16.  }